<template>
    <el-carousel indicator-position="outside">
    <el-carousel-item v-for="(item,index) in swipperList" :key="'swiper' + index">
        <img :src="item.imageUrl" alt="">
    </el-carousel-item>
  </el-carousel>
</template>

<script>
export default {
    //获取轮播图地址 axios配置在全局中，这里调用
    data(){
        return {
            swipperList:[],
        };
    }, 
    // 获取网易云轮播图信息
    async created() {
        let res = await this.$axios.get("/banner");
        console.log(res.banners);
        this.swipperList = res.banners;
        // let res = await this.$axios.get("/recommend/resource")
        // console.log(res);
    }

}
</script>

<style>
    .el-carousel__item h3 {
    color: #475669;
    font-size: 18px;
    opacity: 0.75;
    line-height: 300px;
    margin: 0;
  }
  
  .el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
  }
  
  .el-carousel__item:nth-child(2n+1) {
    background-color: #d3dce6;
  }
</style>